package com.ruoyi.largeScreen.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.largeScreen.mapper.ZjcEchartsCheckedMapper;
import com.ruoyi.largeScreen.domain.ZjcEchartsChecked;
import com.ruoyi.largeScreen.service.IZjcEchartsCheckedService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 控件显示库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-22
 */
@Service
public class ZjcEchartsCheckedServiceImpl implements IZjcEchartsCheckedService 
{
    @Autowired
    private ZjcEchartsCheckedMapper zjcEchartsCheckedMapper;


    @Transactional
    public Boolean saveControls(List<ZjcEchartsChecked> list){
        Boolean result = true;
        zjcEchartsCheckedMapper.deleteZjcEchartsChecked();
        for (ZjcEchartsChecked zjcEchartsChecked : list) {
            zjcEchartsCheckedMapper.insertZjcEchartsChecked(zjcEchartsChecked);
        }
        return result;
    }
    /**
     * 查询控件显示库
     * 
     * @param id 控件显示库主键
     * @return 控件显示库
     */
    @Override
    public ZjcEchartsChecked selectZjcEchartsCheckedById(Long id)
    {
        return zjcEchartsCheckedMapper.selectZjcEchartsCheckedById(id);
    }

    /**
     * 查询控件显示库列表
     * 
     * @param zjcEchartsChecked 控件显示库
     * @return 控件显示库
     */
    @Override
    public List<ZjcEchartsChecked> selectZjcEchartsCheckedList(ZjcEchartsChecked zjcEchartsChecked)
    {
        return zjcEchartsCheckedMapper.selectZjcEchartsCheckedList(zjcEchartsChecked);
    }

    /**
     * 新增控件显示库
     * 
     * @param zjcEchartsChecked 控件显示库
     * @return 结果
     */
    @Override
    public int insertZjcEchartsChecked(ZjcEchartsChecked zjcEchartsChecked)
    {
        return zjcEchartsCheckedMapper.insertZjcEchartsChecked(zjcEchartsChecked);
    }

    /**
     * 修改控件显示库
     * 
     * @param zjcEchartsChecked 控件显示库
     * @return 结果
     */
    @Override
    public int updateZjcEchartsChecked(ZjcEchartsChecked zjcEchartsChecked)
    {
        return zjcEchartsCheckedMapper.updateZjcEchartsChecked(zjcEchartsChecked);
    }

    /**
     * 批量删除控件显示库
     * 
     * @param ids 需要删除的控件显示库主键
     * @return 结果
     */
    @Override
    public int deleteZjcEchartsCheckedByIds(Long[] ids)
    {
        return zjcEchartsCheckedMapper.deleteZjcEchartsCheckedByIds(ids);
    }

    /**
     * 删除控件显示库信息
     * 
     * @param id 控件显示库主键
     * @return 结果
     */
    @Override
    public int deleteZjcEchartsCheckedById(Long id)
    {
        return zjcEchartsCheckedMapper.deleteZjcEchartsCheckedById(id);
    }
}
